import { defineStore } from 'pinia';
import { ref, computed } from 'vue';

// 使用组合式 API 定义权限 Store
export const usePermissionStore = defineStore('permission', () => {
  // 定义状态
  const permissions = ref(['sys:user:add','sys:user:edit','sys:user:del']);

  function changePermissions(newPermissions) {
   
    
    permissions.value = newPermissions.permission;
    console.log('修改了',permissions.value);
  }

  // 返回状态和方法
  return {
    permissions,
    changePermissions
  };
});